home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13247 < prev    next >
Encoding:
Text File  |  1996-08-05  |  902 b   |  24 lines

  1. Newsgroups: comp.lang.c++
  2. Path: presby.edu!jtbell
  3. From: jtbell@presby.edu (Jon Bell)
  4. Subject: Re: Which is better????
  5. Message-ID: <Dos016.4qK@presby.edu>
  6. Date: Sun, 24 Mar 1996 14:24:41 GMT
  7. References: <3155559E.7120@dial.pipex.com>
  8. Organization: Presbyterian College, Clinton, South Carolina USA
  9.  
  10.   <gs94@dial.pipex.com> wrote:
  11. >I have a project where data is passed between functions, as is fairly normal in a 
  12. >C++ program. What I would like to know is:
  13. >
  14. >Which is better / faster, passing data by pointers or by reference, e.g.
  15.  
  16. There shouldn't be any difference in speed between pointers and 
  17. references.  References are just pointers that you can't "re-point" to 
  18. something else, and that are automatically dereferenced whenever you use 
  19. them.
  20.  
  21. -- 
  22. Jon Bell <jtbell@presby.edu>                        Presbyterian College
  23. Dept. of Physics and Computer Science        Clinton, South Carolina USA
  24.